Thunks and the λ-Calculus
نویسندگان
چکیده
Thirty-five years ago, thunks were used to simulate call-by-name under call-by-value in Algol 60. Twenty years ago, Plotkin presented continuation-based simulations of call-by-name under call-by-value and vice versa in the λ-calculus. We connect all three of these classical simulations by factorizing the continuation-based call-by-name simulation Cn with a thunk-based call-by-name simulation T followed by the continuation-based call-by-value simulation Cv extended to thunks.
منابع مشابه
A New One-Pass Transformation into Monadic Normal Form
We present a translation from the call-by-value λ-calculus to monadic normal forms that includes short-cut boolean evaluation. The translation is higher-order, operates in one pass, duplicates no code, generates no chains of thunks, and is properly tail recursive. It makes a crucial use of symbolic computation at translation time.
متن کاملCall-by-name linguistic side effects
We propose a typed call-by-name λ-calculus with shift, reset and strict functions and describe its linguistic applications, improving on the previous continuation-based analyses of quantification, binding, raised and in-situ wh-questions, binding in wh-questions, and superiority. The evaluation order is not fixed left-to-right: rather, it is determined by the demand for values exerted by reset ...
متن کاملEpic - A Library for Generating Compilers
Compilers for functional languages, whether strict or nonstrict, typed or untyped, need to handle many of the same problems, for example thunks, lambda lifting, optimisation, garbage collection, and system interaction. Although implementation techniques are by now well understood, it remains difficult for a new functional language to exploit these techniques without either implementing a compil...
متن کاملThunks (Continued)
Call-by-name can be simulated in a call-by-value setting using \thunks" (i.e., parameterless procedures) or continuation-passing-style (CPS). In this paper we uncover a relationship between the two simulations. We prove that the call-by-value CPS transformation Cv, when applied to a term T (t) which simulates call-by-name using thunks, yields a term identical to the call-by-name CPS transformat...
متن کاملNotes on homotopy λ-calculus
2 Homotopy λ-calculus 16 1 Type systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2 Homotopy λ-calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3 Basic layer syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4 Basic layer semantics in Top . . . . . . . . . . . . . . . . . . . . . . . . ...
متن کامل